<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:74:"/www/wwwroot/zaozao/public/../application/admin/view/bill/onekey_list.html";i:1597203633;s:59:"/www/wwwroot/zaozao/application/admin/view/public/head.html";i:1597211856;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>支付宝生活缴费系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/admin/css/font.css">
	<link rel="stylesheet" href="/static/admin/css/xadmin.css">
	<!--<link rel="stylesheet" href="/static/admin/css/bootstrap.min.css">
	<link rel="stylesheet" href="/static/admin/js/bootstrap.min.js">-->
	
    <script src="/static/admin/js/jquery.min.js"></script>
    <script src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">账单管理</a>
        <a><cite>一键收款</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">

      </div>
      <xblock>
      </xblock>
      <table class="layui-table"  id="table">
        <thead>
          <tr>
            <th>小区名称</th>
            <th>完整门牌</th>
            <th>业主姓名</th>
            <th>费用类型</th>
            <th>账期</th>
            <th>账单金额</th>
            <th>应收金额</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach($onekey as $one): ?>
          <tr>
            <td><?php echo $one['community_name']; ?></td>
            <td><?php echo $one['room_address']; ?></td>
            <td><?php echo $one['owner_name']; ?></td>
            <td><?php echo $one['cost_type']; ?></td>
            <td><?php echo $one['acct_period']; ?></td>
            <td><?php echo $one['bill_entry_amount']; ?>元</td>
            <td><?php echo $one['bill_entry_amount']; ?>元</td>
          </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
      <form class="layui-form" style="margin-left: 80px;">
        <input type="hidden" value="<?php echo $id; ?>" name='id'/>
        <div class="layui-form-item">
            <div class="layui-form-item">
                <label for="L_total_money" class="layui-form-label">
                    <span class="x-red">*</span>账单总金额:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="L_total_money" name="total_money" required="" lay-verify="required"
                    autocomplete="off" class="layui-input" style="width: 300px;" value="<?php echo $sum; ?>元" disabled="true">
                </div>
            </div>
            <div class="layui-form-item">
            <label for="L_pay_type" class="layui-form-label">
                <span class="x-red">*</span>付款方式:
            </label>
            <div class="layui-input-inline" style="width: 300px;">
                <select name="pay_type" lay-verify="required">
                    <option value=""><------选择付款类型------></option>
                    <?php foreach($paytype as $type): ?>
                    <option value="<?php echo $type['name']; ?>"><?php echo $type['name']; ?></option>
                    <?php endforeach; ?>
                </select>
            </div>
            </div>
            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red"></span>备注:
                </label>
                <div class="layui-input-inline">
                    <input type="text" name="remarks" class="layui-input" style="width:300px;">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="add" lay-submit="">
                    一键收款
                </button>
            </div>
        </div>
    </form>
    </div>
    <script>
        layui.use(['form'], function() {
            $ = layui.jquery;
            var form = layui.form,layer = layui.layer;
            
            form.on('submit(add)', function(data){
                console.log(data.field);
                
                $.ajax({  
                  type: 'post',  
                  url: "<?php echo url('onekeyBillList'); ?>", 
                  data: {  
                      id:data.field.id,
                      pay_type:data.field.pay_type,
                      remarks:data.field.remarks,
                      
                      total_money:data.field.total_money
                      
                  },  
                  success: function(data){ 
                    if(data=='ok'){
                      layer.alert("付款成功", {icon: 6},function () {
                            // 获得frame索引
                            var index = parent.layer.getFrameIndex(window.name);
                            //关闭当前frame
                            parent.layer.close(index);
                            window.parent.location.reload();
                        });
                    }else{
                      layer.msg(data);
                    }
                  }  
              });    
                //发异步，把数据提交给php
                /*layer.alert("增加成功", {icon: 6},function () {
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                });*/
                return false;
              });
        })
      </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>
  </body>

</html>